package cn.itcast.mapper;

import cn.itcast.domain.Catalog;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CatalogMapper {
    @Select("select * from st_catalog")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "remark",property = "remark"),
            @Result(column = "state",property = "state"),
            @Result(column = "create_time",property = "createTime"),
            @Result(column = "course_id",property = "courseId"),
            @Result(property = "course",column = "course_id",
            one=@One(select = "cn.itcast.mapper.CourseMapper.findByCid"))

    })
    List<Catalog> findAll();
}
